package com.common.util;

import com.common.dto.RankDTO;
import com.common.entity.Developer;
import com.common.vo.DeveloperVO;

public class DeveloperConverter {
    public static DeveloperVO convertToVO(Developer developer) {
        if (developer == null) {
            return null;
        }

        DeveloperVO developerVO = new DeveloperVO();
        developerVO.setUserName(developer.getUserName());
        developerVO.setCommits(developer.getCommits());
        developerVO.setPrs(developer.getPrs());
        developerVO.setIssues(developer.getIssues());
        developerVO.setTotalstart(developer.getTotalstart());
        developerVO.setForks(developer.getForks());
        developerVO.setStart(developer.getStart());
        developerVO.setPublic_repos(developer.getPublicRepos());
        developerVO.setFollowers(developer.getFollowers());
        developerVO.setLocation(developer.getLocation());
        developerVO.setAvatar_url(developer.getAvatarUrl());

        developerVO.setLevel(developer.getLevel());
        developerVO.setPercentile(developer.getPercentile());

        return developerVO;
    }
}
